package com.ruoyi.mentor.controller;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.mentor.domain.UpdatePassword;
import com.ruoyi.mentor.service.impl.UpdatePasswordServiceImpl;
import io.swagger.annotations.Api;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author LH
 * @Description
 * @Date Create in 11:19 2021/6/2
 */
@Api(value = "第一次登录时提醒用户修改密码", tags = {"第一次登录时提醒用户修改密码"})
@RequiredArgsConstructor(onConstructor_ = @Autowired)
@RestController
@RequestMapping("/mentor/password")
public class UpdatedPasswordController {

    @Autowired
    UpdatePasswordServiceImpl updatePasswordService;

    @GetMapping("/{userId}")
    public AjaxResult getByUserId(@PathVariable Long userId){
        UpdatePassword res = updatePasswordService.getOne(new QueryWrapper<UpdatePassword>().eq("user_id",userId));
        return AjaxResult.success(res);
    }
}
